
%\documentclass[letterpaper,12pt]{article}
%\usepackage[x11names,rgb]{xcolor}
%\usepackage{tikz}
%\usetikzlibrary{snakes}
%\usetikzlibrary{arrows}
%\usetikzlibrary{shapes}
%\usetikzlibrary{backgrounds}
%\usepackage{amsmath}
%\oddsidemargin 0in
%\evensidemargin 0in
%\topmargin 0in
%\headheight 0in
%\headsep 0in
%\textheight 9in
%\textwidth 6.5in
%\begin{document}
%\pagestyle{empty}
%\vspace*{\fill}
%\begin{center}
\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=1.8]
	
	\draw[fill=blue!60,draw=blue!60] (0,2) rectangle +(2,0.2);
	\draw[fill=blue!60,draw=blue!60] (1.8,2) rectangle +(0.2,2);
	
	\draw[fill=pink,draw=pink] (0,1.8) rectangle +(2.2,0.2);
	\draw[fill=pink,draw=pink] (2,1.8) rectangle +(0.2,2.2);
	
	\draw[semithick, blue, xstep=1, ystep=1] (0,0) grid (4,4);
	\draw[semithick, blue, xstep=0.5, ystep=0.5] (1,1) grid (2,2);
	\draw[semithick, blue, xstep=0.5, ystep=0.5] (2,2) grid (3,3);
	
	\draw[semithick, red, xstep=2, ystep=2] (0,0) grid (4,4);
	\draw[semithick] (0,0) rectangle (4,4);
	
	\draw[semithick, blue] (4.2,3.8) -- +(0.4,0);
	\draw[semithick, red] (4.2,3) -- +(0.4,0);
	\draw[fill=blue!60,draw=blue!60] (4.2,2) rectangle +(0.4,0.2);
	\draw[fill=pink,draw=pink] (4.2,1) rectangle +(0.4,0.2);
	
	\draw (5.7,3.7) node[above] {\tiny{Intra-processor}};
	\draw (5.7,3.85) node[below] {\tiny{boundaries}};
	
	\draw (5.7,2.9) node[above] {\tiny{Inter-processor}};
	\draw (5.7,3.05) node[below] {\tiny{boundaries}};
	
	\draw (5.7,1.9) node[above] {\tiny{Local boundary}};
	\draw (5.7,2.05) node[below] {\tiny{octants}};
	
	\draw (5.7,0.9) node[above] {\tiny{Remote boundary}};
	\draw (5.7,1.05) node[below] {\tiny{octants}};
	
	\end{tikzpicture}%%
\end{preview}
\end{document}

%\end{center}
%\vspace*{\fill}
%\end{document}

    	